import { ModalForm, ProFormText } from '@ant-design/pro-components'
import { Button, Space, message, Image } from 'antd'

interface PreviewImageProps {
  name: string
  url: string
}
const PreviewImage: React.FC<PreviewImageProps> = (props) => {
  return (
    <Space>
      <ModalForm
        title={props.name}
        trigger={<a>{props.name}</a>}
        submitter={false}
        onFinish={async (values) => {
          console.log(values)
          message.success('提交成功')
          return true
        }}>
        <Image src={`/api/${props.url}`} />
      </ModalForm>
    </Space>
  )
}

export default PreviewImage
